<!DOCTYPE html>
<html>

<head>
    <meta name="layout" content="main2"/>
    <g:set var="entityName" value="${message(code: 'workflowInstanceStage.label', default: 'workflowInstanceStage')}"/>

    <title>工作流阶段：${this.workflowInstanceStage?.name}</title>
</head>

<body>

<div class="main-body">
    <div class="page-wrapper">
        <!-- Page-header start -->
        <div class="page-header">
            <div class="page-header-title">
                <h4>工作流阶段：${this.workflowInstanceStage?.name}</h4>
            </div>

            <div class="page-header-breadcrumb">
                <ul class="breadcrumb-title">
                    <li class="breadcrumb-item">
                        <a href="/salesDashboard/index">
                            <i class="icofont icofont-home"></i>
                        </a>
                    </li>
                    <li class="breadcrumb-item">
                        <g:link controller="workflowInstance" action="show" id="${this.workflowInstanceStage?.instance?.id}">工作流2.0</g:link>
                    </li>
                    <li class="breadcrumb-item"><a href="#!">工作流阶段：${this.workflowInstanceStage?.name}</a>
                    </li>
                </ul>
            </div>
        </div>
        <!-- Page-header end -->
        <!-- Page-body start -->
        <div class="page-body">
        <g:if test="${flash.message}">
            <div class="message alert alert-info" role="status">${flash.message}
                <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
                        aria-hidden="true">×</span></button>
            </div>
        </g:if>
            <!-- Hover table card start -->
            <div class="card">
                <div class="card-header">
                    <h5>工作流阶段：${this.workflowInstanceStage?.name}</h5>

                    <div class="card-header-right">
                        <g:link action="edit" resource="${this.workflowInstanceStage}" data-toggle="tooltip" data-placement="top"
                                title="" data-original-title="编辑">
                            <i class="icofont icofont-edit"></i>
                        </g:link>

                        <i class="icofont icofont-rounded-down"></i>
                    </div>
                </div>

            <div class="card-block">
                <div class="form-group row">
                    <label class="col-md-2 col-form-label">名称</label>

                    <div class="col-md-3">
                        <span class="cont">${this.workflowInstanceStage?.name}</span>
                    </div>
                    <label class="col-md-2 col-form-label">执行次序</label>

                    <div class="col-md-3">
                        <span class="cont">${this.workflowInstanceStage?.executionSequence}</span>
                    </div>
                </div>


                <div class="form-group row">
                    <label class="col-md-2 col-form-label">是否回退</label>

                    <div class="col-md-3">
                        <span class="cont">${this.workflowInstanceStage?.canReject}</span>
                    </div>

                </div>

            </div>
        </div>


             <div class="card">
                    <div class="card-header">
                        <h5>约束条件</h5>
    
                        <div class="card-header-right">
                            <sec:ifNotGranted roles="ROLE_EVENT_CONFIGURATION">
                                <g:link action="create" controller="workflowInstanceCondition" params="[stage: this.workflowInstanceStage.id]"
                                        data-toggle="tooltip"
                                        data-placement="top" title=""
                                        data-original-title="新增"><i class="icofont icofont-plus"></i></g:link>
                            </sec:ifNotGranted>
    
                            <i class="icofont icofont-rounded-down"></i>
                        </div>
                    </div>
    
                    <div class="card-block dt-responsive">
    
                        <div class="table-responsive">
                            <div id="dom-jqry_wrapper" class="dataTables_wrapper dt-bootstrap4">
                                <div class="table-responsive">
                                    <table class="table table-striped table-hover table-bordered">
                                        <thead>
                                        <th>执行次序</th>
                                        <th>组件</th>
                                        <th>分支</th>
                                        <th>描述</th>
                                        <th>日志</th>
                                        <th width="10%" class="text-center">操作</th>
                                        </thead>
                                        <tbody>
                                        <g:each in="${this.workflowInstanceConditions}">
                                            <tr>
    
                                                <td>
                                                    ${it?.executeSequence}
                                                </td>
                                                <td>
                                                    ${it?.component?.name}
                                                </td>
                                                <td>
                                                    ${it?.nextStage?.name}
                                                </td>
                                                <td>
                                                    ${it?.message}
                                                </td>
                                                <td>${it?.log}</td>
                                                <td width="15%" class="text-center">
                                                    <sec:ifNotGranted roles="ROLE_EVENT_CONFIGURATION">
                                                        <g:link class="m-r-15 text-primary"
                                                                controller="workflowInstanceCondition" action="edit"
                                                                id="${it?.id}">
                                                            <i class="icofont icofont-ui-edit"></i>
                                                        </g:link>
    
                                                        <g:form controller="workflowInstanceCondition" action="delete"
                                                                style="display: inline-block"
                                                                id="${it.id}"
                                                                method="DELETE">
                                                            <button class="deleteBtn text-danger" type="button">
                                                                <i class="icofont icofont-trash"></i>
                                                                
                                                            </button>
                                                        </g:form>
                                                    </sec:ifNotGranted>
    
                                                </td>
                                            </tr>
    
                                        </g:each>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
    
                </div>
            <div class="card">
                <div class="card-header">
                    <h5>事件</h5>
    
                    <div class="card-header-right">

                        <sec:ifNotGranted roles="ROLE_CONDITION_RULEENGINE">
                            <g:link action="create" controller="workflowInstanceEvent" params="[stage: this.workflowInstanceStage.id]"
                                    data-toggle="tooltip"
                                    data-placement="top" title=""
                                    data-original-title="新增"><i class="icofont icofont-plus"></i></g:link>
                        </sec:ifNotGranted>
    
                        <i class="icofont icofont-rounded-down"></i>
                    </div>
                </div>
    
                <div class="card-block dt-responsive">
    
                    <div class="table-responsive">
                        <div id="dom-jqry_wrapper" class="dataTables_wrapper dt-bootstrap4">
                            <div class="table-responsive">
                                <table class="table table-striped table-hover table-bordered">
                                    <thead>
                                    <tr>
                                        <g:sortableColumn property="executeSequence"
                                                          title="${message(code: 'workflowInstanceEvent.executeSequence.label', default: '执行次序')}"/>
                                        <g:sortableColumn property="isSynchronous"
                                                          title="${message(code: 'workflowInstanceEvent.isSynchronous.label', default: '同步执行')}"/>
                                        <g:sortableColumn property="component"
                                                          title="${message(code: 'workflowInstanceEvent.component.label', default: '组件')}"/>
                                        <g:sortableColumn property="log"
                                                          title="${message(code: 'workflowInstanceEvent.log.label', default: '日志')}"/>
                                        <g:sortableColumn property="startTime"
                                                          title="${message(code: 'workflowInstanceEvent.startTime.label', default: '开始时间')}"/>
                                        <g:sortableColumn property="endTime"
                                                          title="${message(code: 'workflowInstanceEvent.endTime.label', default: '结束时间')}"/>
                                        <g:sortableColumn width="10%" property="operation" class="text-center" title="操作"/>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <g:each in="${this.workflowInstanceEvents}">
                                        <tr>
                                            <td>
                                                ${it?.executeSequence}
                                            </td>
                                            <td>
                                                ${it?.isSynchronous}
                                            </td>
                                            <td>
                                                ${it?.component?.name}
                                            </td>
                                            <td>${it?.log}</td>
                                            <td>${it?.startTime}</td>
                                            <td>${it?.endTime}</td>
    
                                            <td width="10%" class="text-center">
                                                <sec:ifNotGranted roles="ROLE_CONDITION_RULEENGINE">
                                                    <g:link class="m-r-15 text-primary"
                                                            controller="workflowInstanceEvent" action="edit"
                                                            id="${it?.id}">
                                                        <i class="icofont icofont-ui-edit"></i>
                                                    </g:link>
                                                    <g:form controller="workflowInstanceEvent" action="delete" id="${it.id}" style="display: inline-block"
                                                            method="DELETE">
                                                        <button class="deleteBtn text-danger" type="button">
                                                            <i class="icofont icofont-trash"></i>
                                                            
                                                        </button>
                                                    </g:form>
                                                </sec:ifNotGranted>
                                            </td>
    
                                        </tr>
    
                                    </g:each>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
    
            </div>
            <div class="card">
                <div class="card-header">
                    <h5>权限</h5>
    
                    <div class="card-header-right">
                        <sec:ifNotGranted roles="ROLE_EVENT_CONFIGURATION,ROLE_CONDITION_RULEENGINE">
                            <g:link action="create" controller="workflowInstanceUser" params="[stage: this.workflowInstanceStage.id]"
                                    data-toggle="tooltip"
                                    data-placement="top" title=""
                                    data-original-title="新增"><i class="icofont icofont-plus"></i></g:link>
                        </sec:ifNotGranted>
    
                        <i class="icofont icofont-rounded-down"></i>
                    </div>
                </div>
    
                <div class="card-block dt-responsive">
    
                    <div class="table-responsive">
                        <div id="dom-jqry_wrapper" class="dataTables_wrapper dt-bootstrap4">
                            <div class="table-responsive">
                                <table class="table table-striped table-hover table-bordered">
                                    <thead>
                                    <tr>
                                        <g:sortableColumn property="user"
                                                          title="用户"/>
                                        <g:sortableColumn property="authority"
                                                          title="用户"/>
                                        <g:sortableColumn width="10%" class="text-center" property="operation"
                                                          title="操作"/>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <g:each in="${this.workflowInstanceUsers}">
                                        <tr>
                                            <td>${it.user}</td>
                                            <td>
                                                ${it?.authority?.name}
                                            </td>
                                            <td class="text-center">
                                                <sec:ifNotGranted roles="ROLE_EVENT_CONFIGURATION,ROLE_CONDITION_RULEENGINE">
                                                    <g:link class="m-r-15 text-primary"
                                                            controller="workflowInstanceUser" action="edit"
                                                            id="${it?.id}">
                                                        <i class="icofont icofont-ui-edit"></i>
                                                    </g:link>
                                                    <g:form controller="workflowInstanceUser" action="delete" id="${it.id}" style="display:inline-block"
                                                            method="DELETE">
                                                        <button class="deleteBtn text-danger" type="button">
                                                            <i class="icofont icofont-trash"></i> </button>
                                                    </g:form>
                                                </sec:ifNotGranted>
                                            </td>
                                        </tr>
                                    </g:each>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
    
            </div>
            <div class="card">
                <div class="card-header">
                    <h5>消息</h5>
    
                    <div class="card-header-right">
                        <sec:ifNotGranted roles="ROLE_EVENT_CONFIGURATION,ROLE_CONDITION_RULEENGINE">
                            <g:link action="create" controller="workflowInstanceNotification" params="[stage: this.workflowInstanceStage.id]"
                                    data-toggle="tooltip"
                                    data-placement="top" title=""
                                    data-original-title="新增"><i class="icofont icofont-plus"></i></g:link>
                        </sec:ifNotGranted>
    
                        <i class="icofont icofont-rounded-down"></i>
                    </div>
                </div>
    
                <div class="card-block dt-responsive">
    
                    <div class="table-responsive">
                        <div id="dom-jqry_wrapper" class="dataTables_wrapper dt-bootstrap4">
                            <div class="table-responsive">
                                <table class="table table-striped table-hover table-bordered">
                                    <thead>
                                    <tr>
                                        <g:sortableColumn property="user"
                                                          title="用户"/>
                                        <g:sortableColumn property="messageTemplate"
                                                          title="${message(code: 'workflowInstanceNotification.messageTemplate.label', default: '消息模板')}"/>
                                        <g:sortableColumn property="toManager"
                                                          title="${message(code: 'workflowInstanceNotification.toManager.label', default: '推送主管')}"/>
                                        <g:sortableColumn property="cellphone"
                                                          title="${message(code: 'workflowInstanceNotification.cellphone.label', default: '手机号')}"/>
                                        <g:sortableColumn width="10%" class="text-center" property="operation"
                                                          title="操作"/>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <g:each in="${this.workflowInstanceNotifications}">
                                        <tr>
                                            <td>${it?.user}</td>
                                            <td>${it?.messageTemplate}</td>
                                            <td>${it?.toManager}</td>
                                            <td>
                                                <pre>
                                                    <code>${it?.cellphone}</code>
                                                </pre>
                                            </td>
                                            <td class="text-center">
                                                <sec:ifNotGranted roles="ROLE_EVENT_CONFIGURATION,ROLE_CONDITION_RULEENGINE">
                                                    <g:link class="m-r-15 text-primary"
                                                            controller="workflowInstanceNotification" action="edit"
                                                            id="${it?.id}">
                                                        <i class="icofont icofont-ui-edit"></i>
                                                    </g:link>
                                                    <g:form controller="workflowInstanceNotification" action="delete" id="${it?.id}" style="display:inline-block"
                                                            method="DELETE">
                                                        <button class="deleteBtn text-danger" type="button">
                                                            <i class="icofont icofont-trash"></i> </button>
                                                    </g:form>
                                                </sec:ifNotGranted>
                                            </td>
                                        </tr>
                                    </g:each>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
    
            </div>
        </div>
        <!-- Page-body end -->

    </div>
</div>

</body>

</html>


